package com.me.mapper;

import com.me.pojo.Pokemon;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface PokemonMapper {


    //查询所有宝可梦

    @Select("select * from tb_pokemon")
    List<Pokemon> selectall();

    @Options(useGeneratedKeys = true,keyColumn = "id", keyProperty = "id")
    @Insert("insert into tb_pokemon values(null,#{name},#{type},#{skill},#{describe},#{time})")
    void addpokemon(Pokemon pokemon);

    @Select("select * from tb_pokemon where id=#{id}")
    Pokemon selectpokemonbyid(int id);

    void updatepokemon(Pokemon pokemon);

    @Delete("delete from tb_pokemon where id=#{id}")
    void deletepokemon(int id);

    List<Pokemon> searchpokemonBykeyword(String keyword);

    Integer pokemonCount();




}
